package day0213;

public class ArrayDemo09 {

    public static void main(String[] args) {
        String[] names = {"张三", "李四", "王五", "赵六"};
        double[][] scores = {
                {89.5, 90, 78.5},
                {92, 99.5, 79},
                {88.5, 93.5, 90},
                {98, 95, 93}
        };

        double[] sum = new double[scores.length];

        // 计算每个学生的总成绩 并输出
        for (int i = 0; i < scores.length; i++) {

            for (int j = 0; j < scores[i].length; j++) {
                sum[i] += scores[i][j];
            }

            System.out.println(names[i] + " 的总成绩是：" + sum[i]);
        }


    }
}
